package org.example.project_12.service.impl;

import org.example.project_12.dto.DocumentSearchResultDto;
import org.example.project_12.dto.SpaceStatsDto;
import org.example.project_12.mapper.StatsMapper;
import org.example.project_12.service.StatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class StatsServiceImpl implements StatsService {
    @Autowired
    private StatsMapper statsMapper;

    @Override
    public List<DocumentSearchResultDto> searchDocuments(String keyword) {
        return statsMapper.searchDocumentsByTitle(keyword);
    }

    @Override
    public SpaceStatsDto getSpaceStats(Long spaceId) {
        return statsMapper.getSpaceStats(spaceId);
    }
} 